package com.gonsin.gview.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gonsin.gview.common.bean.EdificeBean;
import com.gonsin.gview.common.bean.UserAndEdificeBean;
import com.gonsin.gview.common.po.EdificeSearchPo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UserAndEdificeMapper extends BaseMapper<UserAndEdificeBean> {


    /**
     * 搜索会务中心
     */

    @Select("<script>" +
            "select g.edifice_key " +
            "from gs_user_user_and_edifice as g " +
            "where g.user_key = #{userKey} and g.edifice_key = #{edificeKey} " +
            "</script>")
    String findRelation(@Param("userKey") String userKey, @Param("edificeKey") String edificeKey);



    @Select("<script>" +
            "select g.edifice_key " +
            "from gs_user_user_and_edifice as g " +
            "where g.user_key = #{userKey}" +
            "</script>")
    List<String> findByUserKey(String userKey);
}
